﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="role_list.aspx.cs" Inherits="admin_manager_adminrule" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>静态页面发布</title>
    <link href="../css/default.css" rel="stylesheet" type="text/css" />
    <script src="../js/CheckBox.js" type="text/javascript"></script>
    <script type="text/javascript">
        function del(obj){
       if(!ischecked(obj)){
        alert("请选择要删除的用户！")
        return;
       }
            var flag=false;
            flag=confirm('此操作不能恢复,您确定删除吗?')
            return flag;
        }
        function ischecked(obj){
        var chechk=false;
          var frm= obj;
          for(var i=0;i<frm.elements.length;i++){
            var e=frm.elements[i];
            if(e.name!=="allbox"&&e.type=="checkbox"&&e.checked){
            chechk=true;
            }
           }
            return chechk;
        }
    </script>
</head>
<body>
    <form id="Form1" name="Form1" runat="server">
    <table width="100%" height="600" border="0" align="left" cellpadding="0" cellspacing="0"
        bgcolor="#FFFFFF">
        <tr>
            <td height="414" align="left" valign="top" class="rightbg">
                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td height="26">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td height="2" bgcolor="#A49B81">
                                    </td>
                                </tr>
                                <tr>
                                    <td height="22" background="../images/position_bg.gif" bgcolor="#EEF6FE" class="subnav"
                                        style="background-repeat: repeat-y; background-position: left; padding-left: 6px;
                                        padding-top: 3px;">
                                        <asp:Label runat="server" ID="header"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td height="1" bgcolor="#B0C9E8">
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td height="16">
                        </td>
                    </tr>
                    <tr>
                        <td height="21">
                            <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td width="25">
                                        &nbsp;
                                    </td>
                                    <td width="100" align="left">
                                        <table width="80" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td width="3">
                                                    <img src="../images/btn_blue_left.gif" width="3" height="21" />
                                                </td>
                                                <td width="26" align="center" background="../images/btn_blue_center.jpg">
                                                    <img src="../images/icon_add.gif" width="16" height="14" />
                                                </td>
                                                <td align="left" background="../images/btn_blue_center.jpg" class="subnav">
                                                    <a href="role_add.aspx?layerid=<%=Layerid%>">新 增</a>
                                                </td>
                                                <td width="3">
                                                    <img src="../images/btn_blue_right.jpg" width="3" height="21" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                    <td width="100" align="center">
                                        <table width="80" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td width="3">
                                                    <img src="../images/btn_blue_left.gif" width="3" height="21" />
                                                </td>
                                                <td width="26" align="center" background="../images/btn_blue_center.jpg">
                                                    <img src="../images/icon_delete.gif" width="15" height="15" />
                                                </td>
                                                <td align="left" background="../images/btn_blue_center.jpg" class="subnav">
                                                    <asp:LinkButton ID="btnDelete"
                                                        runat="server"  OnClientClick="return del(document.forms[0])" OnClick="LinkButton2_Click">删 除</asp:LinkButton>
                                                </td>
                                                <td width="3">
                                                    <img src="../images/btn_blue_right.jpg" width="3" height="21" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td height="16">
                        </td>
                    </tr>
                    <tr>
                        <td  align="left" valign="top" style="padding-left: 10px;">
                            <!--分页开始-->
                            <!--分页结束-->
                            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White"
                                BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="0" GridLines="None"
                                HeaderStyle-VerticalAlign="NotSet" HeaderStyle-HorizontalAlign="Center" PagerStyle-HorizontalAlign="Center"
                                RowStyle-HorizontalAlign="NotSet" PagerStyle-VerticalAlign="Middle" 
                                PagerStyle-Width="97%" Width="97%" AllowPaging="True" AllowSorting="True" 
                                onpageindexchanging="GridView1_PageIndexChanging" PageSize="10" 
                                onselectedindexchanged="GridView1_SelectedIndexChanged">
                                <RowStyle BackColor="#DEDFDE" ForeColor="Black" />                               
                                <Columns>
                                    <asp:TemplateField HeaderText="rid" Visible="False">                                       
                                        <ItemTemplate>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Rid") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>                                   
                                    <asp:TemplateField HeaderText="全选">
                                        <HeaderTemplate>
                                            全选
                                            <input name="allbox" id="allbox" type="checkbox" onclick="CA()" />
                                        </HeaderTemplate>
                                        <ItemTemplate>                                            
                                            <asp:CheckBox ID="DeleteThis"
                                                runat="server" Visible='<%#Eval("rid").ToString()=="1"?false:true %>' />                                                                                               
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="20%" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                         <ItemStyle CssClass="greytd" />
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="Rolename" HeaderText="角色名称">
                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                        <ItemStyle CssClass="greytd" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Remark" HeaderText="备注">
                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                         <ItemStyle CssClass="greytd" />
                                    </asp:BoundField>
                                    <asp:TemplateField HeaderText="管理">
                                        <ItemTemplate>
                                        
                                            <a href='<%# Eval("Rolename", "role_modify.aspx?name={0}&layerid=") %><%=Layerid%>' <%#Eval("rid").ToString()=="1"?"style='display:none;'":"" %> >修改</a>                                           
                                            <a href='role_popedom.aspx?rn=<%# Eval("Rolename") %>&layerid=<%=Layerid%>' <%#Eval("rid").ToString()=="1"?"style='display:none;'":"" %>>权限设置</a>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                         <ItemStyle CssClass="greytd" />
                                    </asp:TemplateField>                                                                 
                                </Columns>
                                <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <PagerTemplate>
                                    <table align="center" bgcolor="#e9e9e9" width="100%">
                                        <tr>
                                            <td style="text-align:center">
                                                第<b><asp:Label ID="lblPageIndex" runat="server" Text="<%#((GridView)Container.Parent.Parent).PageIndex + 1 %>"></asp:Label></b>页
                                                共<b><asp:Label ID="lblPageCount" runat="server" Text="<%# ((GridView)Container.Parent.Parent).PageCount %>"></asp:Label></b>页
                                                <asp:LinkButton ID="btnFirst" runat="server" CausesValidation="False" CommandArgument="First"
                                                    CommandName="Page" Enabled="<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>"
                                                    Text="首页"></asp:LinkButton>
                                                <asp:LinkButton ID="btnPrev" runat="server" CausesValidation="False" CommandArgument="Prev"
                                                    CommandName="Page" Enabled=" <%# ((GridView)Container.NamingContainer).PageIndex != 0 %>"
                                                    Text="上一页"></asp:LinkButton>
                                                <asp:LinkButton ID="btnNext" runat="server" CausesValidation="False" CommandArgument="Next"
                                                    CommandName="Page" Enabled=" <%# ((GridView)Container.NamingContainer).PageIndex != ((GridView)Container.NamingContainer).PageCount - 1 %>"
                                                    Text="下一页"></asp:LinkButton>
                                                <asp:LinkButton ID="btnLast" runat="server" CausesValidation="False" CommandArgument="Last"
                                                    CommandName="Page" Enabled=" <%# ((GridView)Container.NamingContainer).PageIndex != ((GridView)Container.NamingContainer).PageCount - 1 %>"
                                                    Text="尾页"></asp:LinkButton>
                                                <asp:TextBox ID="txtNewPageIndex" runat="server" Text="<%# ((GridView)Container.Parent.Parent).PageIndex + 1%>"
                                                    Width="20px"></asp:TextBox>
                                                <asp:LinkButton ID="btnGo" runat="server" OnClick="GridView1_SelectedIndexChanged" CausesValidation="false" CommandArgument="-1"
                                                    CommandName="Page" Text="GO"></asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>                                    
                                </PagerTemplate>                                    
                            </asp:GridView>
                            <br />
                            <br />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <iframe name="comframe" style="display: none"></iframe>
    </form>
    <!--分页开始-->
    <!--分页结束-->
</body>
</html>
